//
//  CZDiscussCell.swift
//  GZWeibo007
//
//  Created by 陈宗毅 on 15/12/25.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

class CZDiscussCell: UITableViewCell {

 
    var status:CZStatus?  {
    
        didSet{
            
            topView.status = status
            discussConten.text = status?.text
        }
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier:reuseIdentifier)
        
        prepareUI()
        
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
 
    func prepareUI()
    {
        
        contentView.addSubview(topView)
        contentView.addSubview(discussConten)
        
        //自定义布局
        topView.ff_AlignInner(type: ff_AlignType.TopLeft, referView: contentView, size: CGSize(width: UIScreen.mainScreen().bounds.width, height: 53), offset: CGPoint(x: 8, y: 8))
        discussConten.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: topView.nameLabel, size: CGSize(width: 300, height: 18), offset: CGPoint(x: 0, y: 20))
//        discussConten.backgroundColor = UIColor.orangeColor()
//        topView.backgroundColor = UIColor.redColor()
        
    }
    
    // MARK: - 懒加载
    
    
    
    //头部view
//    lazy var headView:UILabel = {
//        let label = UILabel()
//        label.textAlignment = NSTextAlignment.Left
//        label.font = UIFont.systemFontOfSize(12)
//        label.textColor = UIColor.lightGrayColor()
//        return label
//        }()
    
    
    lazy var topView:CZTopView = CZTopView()
    //微博评论内容
    lazy var discussConten:UILabel = {
        let label = UILabel()
        
        // 字体大小
        label.font = UIFont.systemFontOfSize(14)
        
        // 字体颜色
        label.textColor = UIColor.darkGrayColor()
        
        // 换行
        label.numberOfLines = 0
//        label.text = "哈哈哈哈"
        
        // 设置折行文本宽度(换行的宽度)
        label.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 2 * 8
        
        return label
        }()
}
